{% extends "base_employer.html" %}

{% block content %}
<div class="container mt-5">
    <div class="row">
        <div class="col-md-3">
            <div class="card">
                <img src="{{ url_for('static', filename='icons/i.jpg') }}" class="card-img-top" alt="Company Avatar">
                <div class="card-body">
                    <h5 class="card-title">{{ current_user.company_name }}</h5>
                    <p class="card-text">{{ current_user.contact_name }}</p>
                </div>
                <ul class="list-group list-group-flush">
                    <li class="list-group-item"><strong>Email:</strong> {{ current_user.email }}</li>
                    <li class="list-group-item"><strong>Телефон:</strong> {{ current_user.phone_number }}</li>
                </ul>
                <div class="card-body">
                    <a href="#" class="card-link">Настройки</a>
                </div>
            </div>
        </div>
        <div class="col-md-9">
            <h2>Вакансии компании</h2>
            <table class="table table-striped">
                <thead>
                    <tr>
                        <th>Название</th>
                        <th>Описание</th>
                        <th>Действия</th>
                    </tr>
                </thead>
                <tbody>
                    {% for vacancy in current_user.employer.vacancies %}
                    <tr>
                        <td>{{ vacancy.title }}</td>
                        <td>{{ vacancy.description }}</td>
                        <td>
                            <a href="{{ url_for('vacancy.edit_vacancy', vacancy_id=vacancy.id) }}" class="btn btn-primary btn-sm">Редактировать</a>
                            <form action="{{ url_for('vacancy.delete_vacancy', vacancy_id=vacancy.id) }}" method="POST" style="display:inline;">
                                <button type="submit" class="btn btn-danger btn-sm">Удалить</button>
                            </form>
                        </td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>
{% endblock %}
